package com.baizhi.service.ServiceImpl;
import com.baizhi.dao.AlbumDao;
import com.baizhi.dao.AtricleDao;
import com.baizhi.dao.BannerDao;
import com.baizhi.entity.Album;
import com.baizhi.entity.Article;
import com.baizhi.entity.Banner;
import com.baizhi.service.HomePageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
import java.util.Map;


/**
 * Created by Administrator on 2019/4/12.
 */
@Service
public class HomePageServiceImpl implements HomePageService {
    @Autowired
    private BannerDao bannerDao;
    @Autowired
    private AlbumDao albumDao;
    @Autowired
    private AtricleDao atricleDao;

    @Override
    public Map selectAll(Integer userId) {
        Map map=new HashMap();
        List<Banner> banners= bannerDao.selectHomePageBanner();
        List<Album> albums= albumDao.selectHomePageAlbum();
        List<Article> articles= atricleDao.selectHomePageAtricle();
        map.put("banners",banners);
        map.put("albums",albums);
        map.put("articles",articles);
        return map;
    }
}
